//#!/usr/bin/env node --experimental-modules  


import { SNP } from "./snp";


const data = SNP.parse(`

# MHz S RI R 50 

100.000000 0.9272064644381 -0.3014399089958
100.990099 0.9229223881977 -0.3083542170549
101.980198 0.9183366235677 -0.3154605235413
102.970297 0.9134235734625 -0.3227630272696
103.960396 0.9081551664835 -0.3302652775952
104.950495 0.9025006070549 -0.3379699704094
105.940594 0.8964261039552 -0.3458786990911
106.930693 0.8898945772716 -0.3539916511731
107.920792 0.8828653447007 -0.3623072396930
108.910891 0.8752937894196 -0.3708216561143
109.900990 0.8671310135946 -0.3795283293032
110.891089 0.8583234841671 -0.3884172723277
111.881188 0.8488126810904 -0.3974742958289
112.871287 0.8385347629910 -0.4066800634733
113.861386 0.8274202716718 -0.4160089616778
114.851485 0.8153939054253 -0.4254277526613
115.841584 0.8023744023374 -0.4348939773687
116.831683 0.7882745892676 -0.4443540736125
117.821782 0.7730016706665 -0.4537411759454
118.811881 0.7564578544842 -0.4629725688607
119.801980 0.7385414405778 -0.4719467761347
120.792079 0.7191485302722 -0.4805402895397
121.782178 0.6981755531907 -0.4886039738523
122.772277 0.6755228467828 -0.4959592372345
123.762376 0.6510995602811 -0.5023941328255
124.752475 0.6248301795633 -0.5076596652728
125.742574 0.5966629687820 -0.5114667205679
126.732673 0.5665805781625 -0.5134842210424
127.722772 0.5346129470006 -0.5133393241438
128.712871 0.5008524020879 -0.5106207140933
129.702970 0.4654704782884 -0.5048862382232
130.693069 0.4287354429621 -0.4956762432332
131.683168 0.3910287915696 -0.4825338653859
132.673267 0.3528581576821 -0.4650330907119
133.663366 0.3148632952605 -0.4428144961573
134.653465 0.2778113019175 -0.4156271388822
135.643564 0.2425774083644 -0.3833731508847
136.633663 0.2101088196975 -0.3461495233613
137.623762 0.1813714640707 -0.3042799012431
138.613861 0.1572829301722 -0.2583287071228
139.603960 0.1386386950097 -0.2090912598363
140.594059 0.1260418367671 -0.1575569905818
141.584158 0.1198475522668 -0.1048478770943
142.574257 0.1201321462944 -0.0521395235761
143.564356 0.1266918511304 -0.0005762453286
144.554455 0.1390710242211 0.0488072657249
145.544554 0.1566137235887 0.0951469992642
146.534653 0.1785289894269 0.1377869512293
147.524752 0.2039591750298 0.1762913722095
148.514851 0.2320421651610 0.2104350555856
149.504950 0.2619613559086 0.2401775870880
150.495050 0.2929806967201 0.2656283876938
151.485149 0.3244650041544 0.2870087624575
152.475248 0.3558876881350 0.3046156666527
153.465347 0.3868289422479 0.3187901450193
154.455446 0.4169675555223 0.3298918274035
155.445545 0.4460691084742 0.3382796876053
156.435644 0.4739726971706 0.3442985286155
157.425743 0.5005776816029 0.3482702814726
158.415842 0.5258313895074 0.3504890933260
159.405941 0.5497182683306 0.3512192319334
160.396040 0.5722506687341 0.3506949688151
161.386139 0.5934612441165 0.3491217670573
162.376238 0.6133968361862 0.3466782597346
163.366337 0.6321136615809 0.3435186447494
164.356436 0.6496735980824 0.3397752356793
165.346535 0.6661413755719 0.3355609961459
166.336634 0.6815824956310 0.3309719503508
167.326733 0.6960617275865 0.3260894089211
168.316832 0.7096420535241 0.3209819812164
169.306931 0.7223839579967 0.3157073664277
170.297030 0.7343449786868 0.3103139291458
171.287129 0.7455794517663 0.3048420729119
172.277228 0.7561384001948 0.2993254293541
173.267327 0.7660695249660 0.2937918821201
174.257426 0.7754172687239 0.2882644448524
175.247525 0.7842229286002 0.2827620115478
176.237624 0.7925248009328 0.2772999962194
177.227723 0.8003583450197 0.2718908771170
178.217822 0.8077563565190 0.2665446590466
179.207921 0.8147491437416 0.2612692656588
180.198020 0.8213647020745 0.2560708720211
181.188119 0.8276288832766 0.2509541863769
182.178218 0.8335655575004 0.2459226887315
183.168317 0.8391967667225 0.2409788327997
184.158416 0.8445428688624 0.2361242168850
185.148515 0.8496226723068 0.2313597284256
186.138614 0.8544535608598 0.2266856662290
187.128713 0.8590516093510 0.2221018438053
188.118812 0.8634316902737 0.2176076766870
189.108911 0.8676075719141 0.2132022561821
190.099010 0.8715920084814 0.2088844116305
191.089109 0.8753968227715 0.2046527629170
192.079208 0.8790329819017 0.2005057647240
193.069307 0.8825106666405 0.1964417437805
194.059406 0.8858393348403 0.1924589301714
195.049505 0.8890277794543 0.1885554836087
196.039604 0.8920841815896 0.1847295154285
197.029703 0.8950161590214 0.1809791069625
198.019802 0.8978308105578 0.1773023248332
199.009901 0.9005347566212 0.1736972336412


`, 2);

const a = data.values.map( (i) => {
	const [real, imag] = i.params[0];
	return { real, imag, freq: i.freq } ;
});

console.log(JSON.stringify(a, null,2));
